#ifndef GAME_H
#define GAME_H

#include <QWidget>
#include<qpainter.h>
#include<qtimer.h>
#include<QKeyEvent>
#include<qstring.h>

namespace Ui {
class game;
}

class game : public QWidget
{
    Q_OBJECT

public:
    explicit game(QWidget *parent = 0);
    ~game();
    void paintEvent(QPaintEvent *event);
    void InitCat();
    QRect CreateRock_1();
    QRect CreateRock_2();
    QRect CreateRock_3();
    void IsHit_rock_1();
    void IsHit_rock_2();
    void IsHit_rock_3();
    QRect CreateBee_1();
    QRect CreateBee_2();
    void IsHit_bee_1();
    void IsHit_bee_2();
    bool is_bee_1;
    bool is_bee_2;

private slots:
    void Cat_update();
    void rock_1_update();
    void rock_2_update();
    void rock_3_update();
    void run_time_update();
    void bee_1_on();
    void bee_2_on();
    void bee_1_update();
    void bee_2_update();
    void rock_move_step_update();

    void on_pushButton_clicked();

private:
    Ui::game *ui;
    QRect vCatRect;
    void keyPressEvent(QKeyEvent *key);
    void keyReleaseEvent(QKeyEvent *key);
    QTimer *timer;
    QTimer *timer_1;
    QTimer *timer_2;
    int run_time=0;
    int Hp;
    bool blsRun;
    bool blsOver;
    bool blsPause;
    QString sDisplay;
    int nDirection;
    int Cat_step=1;
    QRect rock_1;
    QRect rock_2;
    QRect rock_3;
    QRect Bee_1;
    QRect Bee_2;
    int bee_1_move_step=0;
    int bee_2_move_step=0;
    int rock_move_step=1;
    int bee_hit_times=0;
};


#endif // GAME_H
